// 模拟登录数据
export const mockLoginData = {
  success: true,
  code: 200,
  message: '登录成功',
  data: {
    token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
    userInfo: {
      id: 1,
      username: 'admin',
      email: 'admin@example.com',
      roles: ['admin']
    }
  }
};

// 模拟登录失败数据
export const mockLoginError = {
  success: false,
  code: 401,
  message: '用户名或密码错误'
};

// 模拟登录函数
export const mockLogin = (data) => {
  return new Promise((resolve, reject) => {
    // 模拟网络延迟
    setTimeout(() => {
      // 简单判断，用户名和密码都为 'admin' 时登录成功
      if (data.username === '1365732877@qq.com' && data.password === '123456') {
        resolve(mockLoginData);
      } else {
        reject(mockLoginError);
      }
    }, 500);
  });
};